-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TemplateBinding in custom IControlTemplate implementations #17427
Fix TemplateBinding in custom IControlTemplate implementations #17427
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
Has anybody reported this issue? I wonder how they use custom control templates.
You can test this PR using the following package version. |
I reported it via the customer support system. We have multiple custom template types (data, control, itemspanel...) which capture and restore a dependency injection context. This allows controls generated after the window opens (e.g. virtualised list items) to find the correct dependencies. |
You can test this PR using the following package version. |
* Add failing test for TemplateBinding inside custom control template * Fix TemplateBinding XAML compilation error for custom IControlTemplate --------- Co-authored-by: Max Katz <[email protected]>
What does the pull request do?
This PR allows
TemplateBinding
to work inside customIControlTemplate
implementations.A unit test has been added.
What is the current behavior?
The XAML compiler fails with AVLN3000: Unable to find the ControlTemplate scope for AvaloniaProperty lookup
What is the updated/expected behavior with this PR?
TemplateBinding
works inside any implementation ofIControlTemplate
.